/*     */ package com.qmsk.business.manage.cust.dao;
/*     */ 
/*     */ import com.qmsk.business.sys.basic.SupportDAO;
/*     */ import com.utils.basic.MapUtils;
/*     */ import com.utils.gson.in.GsonHeadManyRows;
/*     */ import com.utils.gson.in.GsonHeadOneRow;
/*     */ import com.utils.gson.out.GsonEbRst;
/*     */ import java.sql.SQLException;
/*     */ import java.util.HashMap;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class CustDAO extends SupportDAO
/*     */ {
/*  27 */   public static final String[] HEADS_ENCRY = { "password", "mp", 
/*  28 */     "tel", "IdNumber", "name" };
/*     */ 
/*     */   public GsonEbRst getMpAndNameByOpenId(String openId)
/*     */     throws SQLException
/*     */   {
/*  38 */     Map params = new HashMap();
/*  39 */     params.put("openId", openId);
/*  40 */     return getGsonOfParams("getMpAndNameByOpenId", params, false);
/*     */   }
/*     */ 
/*     */   public GsonEbRst getGsonOfShopId(Integer shopId, Integer nPageIdx, Short nPageSize)
/*     */     throws SQLException
/*     */   {
/*  53 */     Object[] params = { shopId };
/*  54 */     return getGsonOfParams("select_cust_of_shopId", 
/*  55 */       "count_select_cust_of_shopId", "fullHead", params, nPageIdx, 
/*  56 */       nPageSize);
/*     */   }
/*     */ 
/*     */   public GsonEbRst getGsonOfShopIdCarId(Integer shopId, Integer carId)
/*     */     throws SQLException
/*     */   {
/*  69 */     Object[] params = { shopId, carId };
/*  70 */     return getGsonOfParams("select_cust_of_shopIdCarId", 
/*  71 */       "fullJsonShopIdCarId", params);
/*     */   }
/*     */ 
/*     */   public Long getUserIdOfMp(String mp) throws SQLException {
/*  75 */     Object[] params = { mp };
/*  76 */     return queryForLong("selectSqlUserIdOfMp", params, Long.valueOf(0L));
/*     */   }
/*     */ 
/*     */   public Long getUserIdOfEmail(String email) throws SQLException {
/*  80 */     Object[] params = { email };
/*  81 */     return queryForLong("selectSqlUserIdOfEmail", params, Long.valueOf(0L));
/*     */   }
/*     */ 
/*     */   public Integer getUserIdOfLonginName(String loginName) throws SQLException {
/*  85 */     Object[] params = { loginName };
/*  86 */     return queryForInt("selectSqlUserIdOfLonginName", params, Integer.valueOf(0));
/*     */   }
/*     */ 
/*     */   public GsonEbRst getGsonOfShopIdOpt1(Map<String, ?> params, Integer nPageIdx, Short nPageSize) throws SQLException
/*     */   {
/*  91 */     return getGsonOfParams("select_cust_of_opt1", 
/*  92 */       "select_count_cust_of_opt1", "fullHead", params, nPageIdx, 
/*  93 */       nPageSize);
/*     */   }
/*     */ 
/*     */   public GsonEbRst getGsonOfShopIdOpt2(Map<String, ?> params, Integer nPageIdx, Short nPageSize) throws SQLException
/*     */   {
/*  98 */     return getGsonOfParams("select_cust_of_opt2", 
/*  99 */       "select_count_cust_of_opt2", "select_cust_json_opt2", params, 
/* 100 */       nPageIdx, nPageSize);
/*     */   }
/*     */ 
/*     */   public GsonEbRst getCustNameOfShopId(Map<String, Object> params, Integer nPageIdx, Short nPageSize) throws SQLException
/*     */   {
/* 105 */     return getGsonOfParams("getSqlCustNameOfShopId", params, nPageIdx, 
/* 106 */       nPageSize, true);
/*     */   }
/*     */ 
/*     */   public GsonHeadManyRows getCustOutIdOfShopId(Map<String, Object> params) throws SQLException
/*     */   {
/* 111 */     return getManyRowsOfParams("getSqlOutIdOfShopId", params);
/*     */   }
/*     */ 
/*     */   public Integer getUserIdOfIdNumber(Object idNumber) throws SQLException {
/* 115 */     Object[] params = { idNumber };
/* 116 */     return queryForInt("selectSqlIdNumber", params, Integer.valueOf(0));
/*     */   }
/*     */ 
/*     */   public Long getIsOutId(Object id) throws SQLException {
/* 120 */     Object[] params = { id };
/* 121 */     return queryForLong("selectSqlIsOutId", params, Long.valueOf(0L));
/*     */   }
/*     */ 
/*     */   public Long getOutId(Long id)
/*     */     throws SQLException
/*     */   {
/* 134 */     Object[] params = { id };
/* 135 */     return queryForLong("selectSqlOutId", params, Long.valueOf(0L));
/*     */   }
/*     */ 
/*     */   public Long getIdOfOutId(Long outId) throws SQLException {
/* 139 */     Object[] params = { outId };
/* 140 */     return queryForLong("getIdOfOutId", params, Long.valueOf(0L));
/*     */   }
/*     */ 
/*     */   public String getCustNameOfId(Long id) throws SQLException {
/* 144 */     Map params = new HashMap();
/* 145 */     MapUtils.addToMap(params, "id", id);
/* 146 */     return queryForString("getCustNameOfId", params, null);
/*     */   }
/*     */ 
/*     */   public boolean getIsWxcardNo(String wxCard) throws SQLException {
/* 150 */     Object[] params = { wxCard };
/* 151 */     return queryForBoolean("selectSqlIsWxcardNo", params, Boolean.valueOf(false)).booleanValue();
/*     */   }
/*     */ 
/*     */   public boolean getIsMemberOfCust(Long shopId, String openId) throws SQLException
/*     */   {
/* 156 */     Object[] params = { openId, shopId };
/* 157 */     return queryForBoolean("selectSqlIsMemberOfCust", params, Boolean.valueOf(false)).booleanValue();
/*     */   }
/*     */ 
/*     */   public Long getCustIdOfOpenId(String openId, Long shopId) throws SQLException
/*     */   {
/* 162 */     Object[] params = { openId, shopId };
/* 163 */     return queryForLong("selectSqlOpenIdOfCust", params, Long.valueOf(0L));
/*     */   }
/*     */ 
/*     */   public Long getOpenIdOfMemberId(String openId) throws SQLException {
/* 167 */     Object[] params = { openId };
/* 168 */     return queryForLong("selectSqlOpenIdOfMemberId", params, Long.valueOf(0L));
/*     */   }
/*     */ 
/*     */   public GsonHeadOneRow getCustByOpenId(String openId) throws SQLException {
/* 172 */     Object[] params = { openId };
/* 173 */     return getOneRowOfParams("select_cust_of_openId", params); }
/*     */ 
/*     */   public GsonHeadOneRow getOwnManger(Long customerId) throws SQLException {
/* 176 */     Object[] params = { customerId };
/* 177 */     return getOneRowOfParams("getOwnManger", params);
/*     */   }
/*     */ 
/*     */   public int updateImageUrlByOpenId(String imageUrl, String openId) throws SQLException
/*     */   {
/* 182 */     Map params = new HashMap();
/* 183 */     params.put("imageUrl", imageUrl);
/* 184 */     params.put("openId", openId);
/* 185 */     return update("updateImageUrlByOpenId", params);
/*     */   }
/*     */ 
/*     */   public int checkExist(String name, String mp) throws SQLException {
/* 189 */     Map params = new HashMap();
/* 190 */     params.put("name", name);
/* 191 */     params.put("mp", mp);
/* 192 */     return queryForInt("checkExist", params, Integer.valueOf(0)).intValue();
/*     */   }
/*     */ 
/*     */   public GsonHeadOneRow getCustInfo(String name, String mp) throws SQLException {
/* 196 */     Map params = new HashMap();
/* 197 */     params.put("name", name);
/* 198 */     params.put("mp", mp);
/* 199 */     return getOneRowOfParams("getCustId", params);
/*     */   }
/*     */ 
/*     */   public int checkOpenId(String openId) throws SQLException {
/* 203 */     Map params = new HashMap();
/* 204 */     params.put("openId", openId);
/* 205 */     return queryForInt("checkOpenId", params, Integer.valueOf(0)).intValue();
/*     */   }
/*     */ 
/*     */   public GsonHeadOneRow getOwnMangerByOpenId(String openId) throws SQLException {
/* 209 */     Object[] params = { openId };
/* 210 */     return getOneRowOfParams("getOwnMangerByOpenId", params);
/*     */   }
/*     */ 
/*     */   public int updateMpAndNameByOpenId(String mp, String name, String openId) throws SQLException {
/* 214 */     Map params = new HashMap();
/* 215 */     params.put("openId", openId);
/* 216 */     params.put("name", name);
/* 217 */     params.put("mp", mp);
/* 218 */     return update("updateNameAndMpByOpenId", params);
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\
 * Qualified Name:     com.qmsk.business.manage.cust.dao.CustDAO
 * JD-Core Version:    0.5.3
 */